﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no">
    

    <title>EMLectures</title>
    
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <link href="signin.css" rel="stylesheet">

    <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script type='text/javascript' src='js/public.js'></script>
    <script type="text/javascript">
$("#login").click(function(){
	var userId = $("#username").val();
	var userPwd = hex_sha1($("#password").val());
	var params = "userId=" + userId + "&userPwd=" + userPwd;
    if(userId==""||password=="") {
        alert("用户名和密码不能为空！");
    } else{
        $.ajax({
            url: "json/login",
		    type: "post",
            data:{
                userId:userId,
                userPwd:userPwd },
            dataType:"json",
            async: false,
            success:function(res,status){
			    if (res["result"]["flag"] == "true") {
					window.location.href="StudentIndex-new.html";
			    } else
				    alert("用户名或密码错误！");
            },
        });
	}
});
    </script>
    
  </head>
<style>
 
 body{background-color:#660099}
</style>

<body>

<div class="container">
   <div class="row">
        <div style="text-align:center;margin-top:50px;margin-bottom:70px;background-color:gray;color:white;"><h3>经管院学术讲坛事务系统</h3></div>
   </div>
   
   <div class="row">
        <div class="col-xs-1 col-sm-2 col-md-2 col-lg-2"></div>
         <div class="col-xs-10 col-sm-8 col-md-8 col-lg-8 ">
          <form class="form-horizontal" role="form">
            <div class="form-group">
		<label for="username" class="col-xs-3 col-sm-2 col-md-2 col-lg-2 control-label" ><font color="white">学号</font></label>
                <div class="col-xs-12 col-sm-8 col-md-8 col-lg-8">
                
                    <input type="text" class="form-control" id="username" placeholder="username" required autofocus>
                </div>
            </div> 
            <div class="form-group">
                <label for="password" class="col-xs-3 col-sm-2 col-md-2 col-lg-2 control-label"><font color="white">密码</font></label>
                <div class="col-xs-12 col-sm-8 col-md-8 col-lg-8">
                     <input type="password" class="form-control" id="password" placeholder="password">
                </div>
            </div>
                              
            
            <div class="form-group" style="margin-top:40px;">
               
               <div class="col-xs-1 col-sm-2 col-sm-offset-2 col-md-2 col-lg-2 ">
                    <button id="login" type="submit" class="btn btn-info">
                     login
                    </button>
                    
               </div>
            </div>
           </form>
       
         </div>
  
  </div>
</div>

</body>
</html>
